<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use kartik\select2\Select2;

/* @var $this yii\web\View */
/* @var $model ua_backend\models\User */
/* @var $form yii\widgets\ActiveForm */
//$listData=ArrayHelper::map('正常','禁用');
?>

<div class="row profile">
    <?php $form = ActiveForm::begin(['id' => 'form-profile']); ?>
    <div class="col-md-10">
        <div class="box box-primary">
            <div class="box-body">
                <?php
                if($model->isNewRecord)
                {
                    echo $form->field($model, 'username')->textInput(['maxlength' => true])->label(Yii::t('app', 'Username'));
                }else{
                    echo $form->field($model, 'username',['inputOptions' => ['class'=>'form-control','disabled'=>'']])->textInput(['maxlength' => true])->label(Yii::t('app', 'Username'));
                }
                ?>


                <?= $form->field($model, 'password')->passwordInput(['value'=>$model->password_hash])->label('登录密码') ?>
                <?= $form->field($model, 'rePassword')->passwordInput(['value'=>$model->password_hash])->label('确认密码') ?>

                <hr>
                <?= $form->field($model, 'role')->checkbox(['value'=>20])->label('管理员') ?>

            </div>

        </div>
        <div class="form-group">
            <div class="col-sm-4 no-padding">
                <?php
                if(Yii::$app->controller->action->id=="update" && Yii::$app->session->get('update') == 'succ'){
                ?>
                <div class="has-success"><label class="control-label" for="inputSuccess"><i class="fa fa-check"></i> 密码修改成功！</label></div>
                <?php } ?>
            </div>
            <div class="col-sm-8 no-padding">
                <div  style="float: right">
                    <?= Html::submitButton('<i class="fa fa-save"> </i> 保存', ['class' =>  'btn btn-primary']) ?>
                </div>
            </div>

        </div>
    </div>



    <?php ActiveForm::end(); ?>
</div>
